/* Reset and base */
* 
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body 
{
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}
header {
    position: relative; /* ممكن يكون موجود مسبقًا */
    z-index: 5;
}

/* Headings */
h1 
{
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 
{
    font-size: 1.5rem;
    font-weight: 600;
}

h3 
{
    font-size: 1.25rem;
    font-weight: 600;
}
#show-records-btn 
{
    cursor:pointer;
    color: white;
    font-size: 16px;

}


/* ===============================
   👤 Header User UI - Navy Pro Edition
   =============================== */

/* جعل الهيدر حاوية مرجعية */
.header {
    position: relative;
    padding: 3rem 1rem;
    text-align: center;
}

/* زر Login المطور */
.btn-login {
    position: absolute;
    top: 25px;
    right: 25px;
    background: linear-gradient(135deg, #162b65 0%, #223b71 100%);
    border: 1px solid rgba(147, 197, 253, 0.3);
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* لضمان توسيط الكلمة تماماً */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase; /* جعل الحروف كبيرة يعطي فخامة */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

/* قائمة المستخدم الكحلية الزجاجية */
.user-menu {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(14, 33, 75, 0.85);
    backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.user-name {
    color: #93c5fd; 
    font-weight: 600;
    font-size: 0.95rem;
    /* منع التفاف النص */
    white-space: nowrap;
}

/* زر تسجيل الخروج المطور */
.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5; /* لون أحمر ناعم */
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    /* تحسين التمركز الداخلي للكلمة */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* يرفع النص قليلاً للأعلى ليظهر في المنتصف */
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* إخفاء افتراضي */
.user-menu.hidden {
    display: none !important;
}




/* Background Image */
.bg-image 
{
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.1;
    background-image: url('https://images.unsplash.com/photo-1652212976547-16d7e2841b8c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3Nzg4Nzd8MHwxfHNlYXJjaHwxfHxhYnN0cmFjdCUyMHRlY2hub2xvZ3klMjBibHVlfGVufDF8fHx8MTc2NDYwOTY1N3ww&ixlib=rb-4.1.0&q=80&w=1080');
    background-size: cover;
    background-position: center;
}

.bg-overlay 
{
    position: fixed;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.5), #0f172a);
    z-index: 1;
}


/* Content */
.content 
{
    position: relative;
    z-index: 10;
}

.container 
{
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header 
{
    padding: 3rem 1rem;
    text-align: center;
    position: relative;
}

.header-icons 
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.icon-box 
{
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: icon-appear 1s ease-out forwards, pulse 3s ease-in-out infinite;
    opacity: 0;
}

.icon-box:nth-child(1) 
{
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    animation-delay: 0s, 1s;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
}

.icon-box:nth-child(2) 
{
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    animation-delay: 0.2s, 1.2s;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
}

.icon-box:nth-child(3) 
{
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    animation-delay: 0.4s, 1.4s;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.5);
}

@keyframes icon-appear
{
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse
{
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

.title 
{
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-slide 3s ease infinite, title-appear 1s ease-out;
    background-size: 200% auto;
}

@keyframes gradient-slide
{
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes title-appear
{
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.subtitle 
{
    color: #94a3b8;
    font-size: 1.125rem;
    animation: subtitle-appear 1s ease-out 0.5s backwards;
}

.description 
{
    color: #94a3b8;
    max-width: 42rem;
    margin: 0 auto;
    animation: subtitle-appear 1s ease-out 0.7s backwards;
}

@keyframes subtitle-appear
{
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.buttons-header
{
    display: flex;
    justify-content: center;
    align-items: center;
    justify-content: space-around;
    width: 500px;
    margin: 20px auto;
}
.btn-header
{
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-image: linear-gradient(45deg,#03A9F4 60%,rgba(13, 57, 72, 0.745));
    border-radius: 10px;
    border: none;
    opacity: 0;
    width: 200px;
    transition: box-shadow ease 1s;
    transform: translateY(-20px);
    animation: btn-animated ease forwards 2s;
        font-weight: 500;

    
}
.btn-header:hover
{
    box-shadow: -4px 0 8px 0 #06b6d4;

}
.btn-record
{
    text-decoration: none;
    color: white;
}



.btn-header a
{
    font-size: 1rem;
    color: white;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
}
@keyframes btn-animated
{
    to 
    {
        opacity: 1;
        transform: translateY(0);
    }
}
.btn-welcome
{
    background-image: linear-gradient(45deg,#f45303 20%,rgba(206, 0, 106, 0.938));
    
}



.decorative-line 
{
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: subtitle-appear 1s ease-out 1s backwards;
}

.line 
{
    height: 1px;
    width: 4rem;
}

.line-left 
{
    background: linear-gradient(to right, transparent, #3b82f6);
}

.line-right 
{
    background: linear-gradient(to left, transparent, #3b82f6);
}

/* Calculator Section */
.calculator-wrapper 
{
    max-width: 56rem;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card 
{
    background: #1e293b;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
    overflow: hidden;
}

.card-body 
{
    padding: 2rem;
}

.form-group 
{
    margin-bottom: 1.5rem;
}

.form-label 
{
    display: block;
    color: #93c5fd;
    margin-bottom: 0.5rem;
}

.input-wrapper 
{
    position: relative;
}

.input-icon 
{
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
}

.form-input 
{
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem 0.75rem 3rem;
    color: white;
    transition: all 0.2s;
}

.form-input::placeholder 
{
    color: #64748b;
}

.form-input:focus 
{
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-calculate 
{
    width: 100%;
    background: linear-gradient(to right, #2563eb, #3b82f6);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.btn-calculate:hover 
{
    background: linear-gradient(to right, #1d4ed8, #2563eb);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.5);
}

.btn-calculate:disabled 
{
    background: #475569;
    cursor: not-allowed;
    box-shadow: none;
}

/* Results Section */
.results-section 
{
    border-top: 1px solid #334155;
    background: rgba(15, 23, 42, 0.5);
    padding: 2rem;
}

.results-header 
{
    color: white;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-grid 
{
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px)
{
    .results-grid 
    {
        grid-template-columns: repeat(2, 1fr);
    }
}

.result-card 
{
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.result-card-content 
{
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-icon-wrapper 
{
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-label 
{
    color: #94a3b8;
    font-size: 0.875rem;
}

.result-value 
{
    color: white;
    font-size: 1.25rem;
}

.traffic-badge 
{
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid;
    font-size: 0.875rem;
    text-transform: capitalize;
}

.traffic-light 
{
    color: #4ade80;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.traffic-medium 
{
    color: #facc15;
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
}

.traffic-heavy 
{
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.eta-card 
{
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.5), #1e293b);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.eta-card.ml 
{
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.5), #1e293b);
    border-color: rgba(16, 185, 129, 0.3);
}

.eta-time 
{
    color: white;
    font-size: 1.875rem;
}

.difference-card 
{
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid;
}

.difference-card.positive 
{
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
}

.difference-card.negative 
{
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.difference-content 
{
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.difference-label 
{
    font-size: 0.875rem;
}

.difference-sublabel 
{
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.difference-value 
{
    font-size: 1.875rem;
}

/* Footer */
.footer 
{
    margin-top: 5rem;
    padding: 4rem 1rem 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.5));
}

.footer-grid 
{
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px)
{
    .footer-grid 
    {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px)
{
    .footer-grid 
    {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-brand 
{
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.brand-icon 
{
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-description 
{
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.social-links 
{
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-link 
{
    width: 2.5rem;
    height: 2.5rem;
    background: #1e293b;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.3s;
    text-decoration: none;
}

.social-link:hover 
{
    background: #334155;
    transform: scale(1.1);
}

.social-link.facebook:hover { color: #60a5fa; }
.social-link.twitter:hover  { color: #38bdf8; }
.social-link.instagram:hover { color: #f472b6; }
.social-link.linkedin:hover  { color: #3b82f6; }
.social-link.github:hover    { color: #e2e8f0; }

.contact-info 
{
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item 
{
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.contact-icon 
{
    width: 2.5rem;
    height: 2.5rem;
    background: #1e293b;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-label 
{
    color: #94a3b8;
    font-size: 0.875rem;
}

.contact-value 
{
    color: white;
}

.contact-form 
{
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-control 
{
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    transition: all 0.2s;
}

.form-control::placeholder 
{
    color: #64748b;
}

.form-control:focus 
{
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control 
{
    resize: none;
}

.btn-submit 
{
    width: 100%;
    background: linear-gradient(to right, #2563eb, #7c3aed);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.btn-submit:hover 
{
    background: linear-gradient(to right, #1d4ed8, #6d28d9);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.5);
}

.success-message 
{
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #4ade80;
}

.footer-bottom 
{
    padding-top: 2rem;
    border-top: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px)
{
    .footer-bottom 
    {
        flex-direction: row;
    }
}

.copyright 
{
    color: #64748b;
    font-size: 0.875rem;
}

.footer-links 
{
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-link 
{
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-link:hover 
{
    color: #60a5fa;
}

.info-text 
{
    margin-top: 1.5rem;
    text-align: center;
    color: rgba(147, 197, 253, 0.6);
    font-size: 0.875rem;
}

.hidden 
{
    display: none;
}

@media (max-width: 768px)
{
    .title 
    {
        font-size: 2rem;
    }
}
